//
//  PostList.swift
//  SwiftUiBaseStudy
//
//  Created by Daniel on 2023/11/7.
//

import SwiftUI

struct PostList: View {
   @ObservedObject var store = DataStore()
    
    var body: some View {
        Text("API and JSON")
        List(store.posts) { post in
            VStack(alignment: .leading, spacing: 10.0) {
                Text(post.title)
                Text(post.body)
                    .lineLimit(3)
            }
        }
        .onAppear{
//            getContentData()
        }
    }
}
    
    #Preview {
        PostList()
    }
